package common.utils.properties;

import java.io.IOException;
import java.util.Properties;

public class PropertiesUtil extends Properties {

	private static final long serialVersionUID = 1L;
	
	private static PropertiesUtil propertiesUtil = null;
	
	private PropertiesUtil(String propertiesName){
		try {
			super.load(PropertiesUtil.class.getClassLoader().getResourceAsStream(propertiesName));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public static PropertiesUtil getInstance(){
		if(null == propertiesUtil){
			return new PropertiesUtil("hakka.properties");
		}else{
			return propertiesUtil;
		}
	}
	
	public String getValue(String key){
		return super.getProperty(key);
	}
	

}
